set tempname=#path#name-conv.epub
#newl "#ppthapps\Calibre Portable\Calibre\ebook-convert.exe" |-program file-
"#item" |-input-
"%tempname%" |-output-
#rema justification|--change-justification justify |--change-justification left |-change justification-
#remark change pdf output margins|--margin-left 0 --margin-right 0 --margin-top 0 --margin-bottom 0 |--margin-left 10 --margin-right 10 --margin-top 10 --margin-bottom 10 |--margin-left 20 --margin-right 20 --margin-top 20 --margin-bottom 20 |--margin-left 30 --margin-right 30 --margin-top 30 --margin-bottom 30 |-change pdf output margins-
#remark change pdf paper size|--paper-size a5 |--paper-size a4 |--pdf paper size--
#remark change pdf footer|--pdf-footer-template ^<center^>_PAGENUM_^</center^> |
#rema change font|--embed-font-family "Verdana" |--embed-font-family "Berling Antiqua" |-change font-
#rema change font size|--font-size-mapping 12 --base-font-size 12 |--font-size-mapping 11 --base-font-size 11 |--font-size-mapping 10 --base-font-size 10 |-change font size-
#rema title|--title "#name" |
#rema author(s)|--authors "#name" |--separated by ampersand 
#rema cover|--cover "#path#name.jpg" |--no-default-epub-cover |--docx-no-cover |--preserve-cover-aspect-ratio |--prefer-metadata-cover |--remove-first-image |--cover options--
#rema output profile|--output-profile kindle |--output-profile kindle_dx |--output-profile kindle_fire |--output-profile kindle_pw |--output-profile kobo |--output-profile kindle |--output-profile msreader |--output-profile nook |--output-profile kindle |--output-profile nook_hd_plus |--output-profile sony |--output-profile tablet |--choose output profile--
#newl "#ppthapps\kindlegen\kindlegen.exe" |-program file-
"%tempname%" |-input-
-o "#name.mobi" |-output-
#newl del "%tempname%" |

<comment>
Convert opf/htm/html/epub/zip to mobi, using kindlegen.
Epub file must have 'title' set or the conversion will fail.
-
This script first creates temporary epub file using Calibre, which is then converted to mobi, using Kindlegen.
document==(calibre)=>epub==(kindlegen)==>mobi.